package gui;

import javax.swing.JFrame;
import javax.swing.JPanel;

import business.EnseignantBL;
import business.FormationBL;
import business.StatutEnseignantBL;
import business.TypeEnseignementBL;
import business.TypeHeureBL;

import persistence.model.AbstractModel;
import persistence.model.StatutEnseignant;
import persistence.model.TypeHeure;

public class MainController {

	private static final MainController instance = new MainController();

	private AbstractViewPane currentViewPane = null;
	
	private static MainWindowUI mw;
	
	private MainController() {}
	
	public static void main(String[] args) {
		System.setProperty("apple.laf.useScreenMenuBar", "true"); /* MAC OS X : placer le menu en haut de l'écran */
		
	
		
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGUI();
            }
        });

	}

	private static void createAndShowGUI() {
		mw = new MainWindowUI();
		mw.setVisible(true);
		getInstance().setViewPane(new AcceuilUI());
		
		
	}

	public static MainController getInstance() {
		return instance;
	}

	public void setViewPane(AbstractViewPane newViewPane) {
		mw.setViewPane(newViewPane);
		currentViewPane = newViewPane;
	}
	
	public AbstractViewPane getCurrentViewPane()
	{
		return currentViewPane;
	}
	
	public JFrame getFrame() {
		return mw;
	}
	
}
